import React from 'react';
import {WeaSearchGroup,WeaFormItem,WeaCheckbox} from 'ecCom';
import {WeaLocaleProvider} from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;
import EType from './base/EType';
import ETitle from './base/ETitle';

// 费用报销智能助手
export default class Content_fnaBudgetAssistant extends React.Component {
    state = {
        ePersonalBorrowinInformation: this.props.ePersonalBorrowinInformation,
        eReimbursementInformation: this.props.eReimbursementInformation,
        eReimbursementChart: this.props.eReimbursementChart
    };
    render() {
    const { eReimbursementInformation, ePersonalBorrowinInformation, eReimbursementChart} = this.state;
    
    let EPersonalBorrowinInformation = (
            <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@16z57o`} label={getLabel(126747, '个人借款信息')} labelCol={{span: 6}} wrapperCol={{span: 16}}>
                <WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@mxv2qq`} value={ePersonalBorrowinInformation} onChange={(value)=>this.setState({ePersonalBorrowinInformation: value})}/>
            </WeaFormItem>
        );
    
    let EReimbursementInformation = (
            <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@fc04uu`} label={getLabel(126748, '报销信息')} labelCol={{span: 6}} wrapperCol={{span: 16}}>
                <WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@nbh5je`} value={eReimbursementInformation} onChange={(value)=>this.setState({eReimbursementInformation: value})}/>
            </WeaFormItem>
        );
    
    let EReimbursementChart = (
            <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@a9hmml`} label={getLabel(126750, '报销图表')} labelCol={{span: 6}} wrapperCol={{span: 16}}>
                <WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@2883kt`} value={eReimbursementChart} onChange={(value)=>this.setState({eReimbursementChart: value})}/>
            </WeaFormItem>
        );
        return (
            <div>
                <WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@0ve2xn`} title={getLabel(81711, '基本信息')} needTigger={true} showGroup={true}>
                    <EType ecId={`${this && this.props && this.props.ecId || ''}_EType@kaozzw`} ref="eType" value={this.props.eBaseName}/>
                    {this.props.eShareLevel == '2' ? <ETitle ecId={`${this && this.props && this.props.ecId || ''}_ETitle@4sryvv`} ref="eTitle" eid={this.props.eid} value={this.props.eTitle} {...this.props}/> : ''}
                    {EPersonalBorrowinInformation}
                    {EReimbursementInformation}
                    {EReimbursementChart}
                </WeaSearchGroup>
            </div>
        );
    }

    getSaveValues() {
        return {
            eContentTitle: this.refs['eTitle'] ? this.refs['eTitle'].getSaveValues() : this.props.eTitle,
            eContentPersonalBorrowinInformation: this.state.ePersonalBorrowinInformation,
            eContentReimbursementInformation: this.state.eReimbursementInformation,
            eContentReimbursementChart: this.state.eReimbursementChart
        };
    }
}